package com.qf.common.utils;

import javafx.beans.binding.StringBinding;

import java.util.Random;

/**
 * @author KING
 * @ClassName: com.qf.common.utils.GetSalt
 * @Description: 该类的功能描述
 * @date: 2021/10/27 8:50
 */

public class SaltUtil {
    public static String getSalt(int n) {
        char[] chars = "abcdefghijklnmopqrstuvwxyzABCDEFGHIJKLNMOPQRSTUVWXYZ0123456789@#$%^&*()".toCharArray();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            char ch = chars[new Random().nextInt(chars.length)];
            sb.append(ch);
        }
        return sb.toString();
    }
}
